<%= render_partial "new" %>

<h1>Your clients</h1>

<% if !@clients.empty? %>

<table>
  <tr>
    <th></th>
    <th align="left" class="<%= @sorter.column_order_class('short') %>"><%= link_to 'Short', @sorter.to_link('short') %></th>
    <th align="left" class="<%= @sorter.column_order_class('name') %>"><%= link_to 'Name', @sorter.to_link('name') %></th>
    <th align="left" class="<%= @sorter.column_order_class('url') %>"><%= link_to 'Url', @sorter.to_link('url') %></th>
  </tr>
  
<% for client in @clients %>
  <tr>
    <td><%= link_to_destroy(client)%></td>
    <td><%=h client.short %></td>
    <td><%=h client.name %></td>
    <td><%=h client.url %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => client %></td>
    <td><%= link_to 'List projects', { :controller => "projects", :action => 'list', :id => client } %></td>
    <td><%= link_to 'Add project to client', { :controller => "projects", :action => 'new', :id => client } %></td>
  </tr>
<% end %>
</table>
<%end%>

<%= render_partial "partial/paginator", @client_pages %>
